package com.shop.vuedemo.controller.shop;

import com.shop.vuedemo.annotations.NeedLogin;
import com.shop.vuedemo.model.dto.Result;
import com.shop.vuedemo.model.entity.TzSku;
import com.shop.vuedemo.service.shop.TzSkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * projectName: vueDemo
 * create on 2021/11/14 9:24
 *
 * @author yanbl
 * @Description :
 */
@RestController
public class YamiShopController {

    @Autowired
    private TzSkuService tzSkuService;

    @GetMapping("shop/all")
    public Result getSku() {
        List<TzSku> list = tzSkuService.list();
        return Result.success(list);
    }

    @NeedLogin
    @GetMapping("/login/all")
    public Result getSku2() {
        List<TzSku> list = tzSkuService.list();
        return Result.success(list);
    }

}
